<!DOCTYPE html>
<html lang="en" dir="ltr">

<head>
  <meta charset="utf-8">
  <title></title>
  <link rel="stylesheet" type="text/css" href="<@Rootpath src='index.css' />"/>

  <script type="text/javascript" src="/js/jquery/jquery-1.9.1.js"></script>
  <script type="text/javascript" src="/js/base/base.js"></script>
  <meta http-equiv="content-type" content="text/html;charset=utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

  <style media="screen">
    .listBox {
      width: 1200px;
      margin: 0 auto;
      background-color: #fff;
    }
    .listBoxContent{
      min-height: 327px;
    }
    .list {
      width: 1000px;
      margin: 0 auto;
      padding: 32px 0 27px 0;
      border-bottom: 1px dashed #dcdcdc;
    }

    .list li {
      position: relative;
      font-size: 16px;
      line-height: 38px;
      color: #404040;
      padding-left: 1.3%;
      width: 98.7%;
    }

    .list li a {
      padding-right: 80px;
      color: #404040;
    }

    #changepage {
      width: 100%;
      text-align: center;
      overflow: hidden;
      font-size: 14px;
      padding: 20px 0;
      margin-top: -1px;
      border-top: 1px solid #fff;
    }

    #changepage .up_page,
    #changepage .down_page {
      display: inline-block;
      color: #1b242f;
      text-align: center;
      padding: 6px 4px;
      border: 1px solid #e8e8e8;
      margin: 0 12px;
    }

    .list li span {
      position: absolute;
      right: 0px;
      bottom: 0px;
      display: inline-block;
    }

    .crumbsBox {
      width: 1200px;
      margin: 0 auto;
      background-color: #fff;
    }

    .crumbsBox .crumbs {
      width: 1000px;
      height: 64px;
      margin: 0 auto;
    }

    #breadcrumb {
      width: 100%;
      line-height: 56px;
      font-size: 14px;
      color: #333;
    }


    #breadcrumb a {
      color: #333;
    }

    .repeatX {
      width: 100%;
      background: url(http://www.beijing.gov.cn/images/repeatBg_xb_20181026.png) 0 0 repeat-x;
      height: 8px;
    }
    #breadcrumb a{
      font-size: 20px ;
    }
  </style>

</head>

<body>
  <div class="bd">

    <!-- 头部 -->
    <div class="w">
      <div class="top">
        <div class="left" style="height:78px;">

          <img src='<@Rootpath src="images/gh.png"/>'>
        </div>
        <span class="head_title"></span>
      </div>
      <!--top-->
    </div><!-- w -->

    <!-- 导航 -->
    <div class="nav">
      <div class="w">
        <ul class="navbox">


        </ul>
      </div>
      <!--w-->
    </div>
    <!--nav-->


    <!-- 中间内容 -->
    <div class="w">

      <div class="crumbsBox">
        <div class="crumbs">
          <div id="breadcrumb">
            <!--<a href="../" title="要闻动态" class="CurrChnlCls">要闻动态</a>　&gt;　<a href="./" title="中央部委动态" class="CurrChnlCls"></a>-->
          </div>
          <div class="repeatX"></div>
        </div>
      </div>


      <div class="listBox">
        <div class="listBoxContent">

        </div>

        <div id="changepage">
          <a href="javascript:preVious(0)" class="up_page" target="_self">上一页</a>
          <a href="javascript:next(0)" class="down_page" target="_self">下一页</a>
        </div>
      </div>



    </div><!-- bd -->

    <div class="bottom">
      <div class="w">
        <div class="botbox">
          <div class="botf left"></div>
          <div class="bort left">
            <div>滨海省人民政府 主办 滨海市人民政府办公室承办 滨海市政府办公室负责日常管理与维护</div>
            <div>邮编：888888 联系电话：0310-88888888 邮箱：88888888@888.com</div>
            <div>版权所有 ICP备案/许可证编号为：京ICP备66666666号</div>
          </div>
        </div>
      </div>
    </div>


  </div>
</body>

    <script type="application/javascript" >
      $(function () {
          var page = 1;
          var pageSize = 20;
          var maxPage = 0;

          // 获取文章信息 默认为 page 1 pageize20S
          getDocs(page,pageSize,maxPage);

          $('.up_page').click(function () {
              if(page>1){
                  --page;
                  getDocs(page,pageSize,maxPage);
              }
          });

          $('.down_page').click(function () {
              if(page<maxPage){
                  ++page;
                  getDocs(page,pageSize,maxPage);
              }
          });

          // 获取主页信息
          $.ajax({
              url: "/cmsSite/getSiteInfoBySiteId",
              type: "get",
              data:{
                  siteId:$.GetRequest().siteId
              },
              dataType: 'json',
              success: function (json) {
                  if (json.flag) {
                      var obj = json.data;
                      $('.head_title').html(obj.siteName)
                  }
              }
          })


          // 获取栏目
          $.ajax({
              url: "/cmsChannel/getChannelInfos",
              type: "get",
              data:{
                  'siteId':$.GetRequest().siteId
              },
              dataType: 'json',
              success: function (json) {
                  if (json.flag) {
                      var obj = json.data;
                      var str='<li><a class="node" href="/cmsPub/portal?siteId='+$.GetRequest().siteId+'">首页</a></li>';
                      for(var i = 0; i < obj.length; i ++) {
                          if($.GetRequest().channelId==obj[i].sid){
                              str+= '<li class="focus">'
                          }else {
                              str+='<li>'
                          }
                          str+= '<a class="node" href="/cmsPub/portal?siteId='+$.GetRequest().siteId+'&channelId='+obj[i].sid+'">'+obj[i].chnlName+'</a></li>'
                      }
                      $('.navbox').append(str);
                  }
              }
          });


          // 获取当前栏目信息
          $.ajax({
              url: "/cmsChannel/geiChannelInfoById",
              type: "get",
              data:{
                  channelId:$.GetRequest().channelId
              },
              dataType: 'json',
              success: function (json) {
                  if (json.flag) {
                      var obj = json.data;
                      $('#breadcrumb').html('<a href="/cmsPub/portal?siteId='+$.GetRequest().siteId+'&channelId='+obj.sid+'" title="'+obj.chnlName+'" class="CurrChnlCls">'+obj.chnlName+'</a>');
                      $('title').html(obj.chnlName)
                  }
              }
          })

          
      })

      function getDocs(page,pageSize,maxPage) {
          // 获取栏目下的文档信息
          $.ajax({
              url: "/cmsDocument/selCmsDocs",
              type: "get",
              data:{
                  chnlId:$.GetRequest().channelId,
                  page:page,
                  pageSize:pageSize
              },
              dataType: 'json',
              success: function (json) {
                  if (json.flag) {
                      var obj = json.data;
                      var strAll = '';
                      var strUl = '<ul class="list">';
                      for (var i=0,length=obj.length;i<length;){
                          var object = obj[i];
                          strUl+='<li class="col-md">' +
                              '<a href="/cmsPub/portal?siteId='+$.GetRequest().siteId+'&channelId='+$.GetRequest().channelId+'&chnlDocId='+object.chnlDocId+'" target="_blank" title="'+object.docTitle+'">'+object.docTitle+'</a>'+
                              '<span>'+object.crTime+'</span>'+
                              '</li>';
                          i++;
                          if(i%5==0){
                              strAll+=strUl+'</ul>';
                              strUl ='<ul class="list">';
                          }else if(i==length){
                              strAll+=strUl+'</ul>';
                          }
                      }
                      $('.listBoxContent').html(strAll);

                      if(json.totleNum%20>0){
                          maxPage =json.totleNum%20+1;
                      }else if(json.totleNum%20==0) {
                          maxPage =json.totleNum%20;
                      }
                  }
              }
          })
      }
    </script>

</html>
